<?php
    session_start();
    include('top.php');
    $uid = $_SESSION['id'];
    $log = "select * from user_log where uid = $uid order by time desc";
    $log_result = $link->query($log);
?>

<div class="home-body">
<?php include('info.php'); ?>
    
    <div class="home-container-body">
        <div class="home-side-by-side-start">
            <h2 class="home-title">考生登入日志</h2>
            <table width="100%">
                <tr>
                    <th class="select-th">登入时间</th>
                    <th class="select-th">登入IP</th>
                </tr>
                <?php while($log_row = mysqli_fetch_array($log_result)) { ?>
                <tr>
                    <td class="select-td">
                        <?php echo date("Y-m-d H:i:s",$log_row['time']) ?>
                    </td>
                    <td class="select-td">
                        <?php echo $log_row['ip']; ?>
                    </td>
                </tr>
                <?php } ?>
            </table>
        </div>
    </div>
</div>

<?php include('bottom.php'); ?>